@use "sass:color";
@use "../variables.scss";

.button-wrapper {
  margin-top: 20px;
  .btn {
    margin-right: 6px;

    &:last-child {
      margin-right: 0;
    }
  }
}

.btn {
  cursor: pointer;
  padding: 7px 12px 8px;
  font-size: 12px;
  font-weight: 700;
  line-height: 15px;
  display: inline-block;
  border: 0;
  border-radius: 3px;
  transition: background-color color border 0.2s;
  outline: none;
  position: relative;

  &.small {
    padding: 4px 12px 5px;
  }

  &.large {
    padding: 11px 12px 12px;
    font-size: 14px;
    line-height: 17px;
  }

  &.rounded {
    border-radius: 60px;
  }

  &.auth {
    padding: 12px 20px 11px;
    border-radius: 40px;
    border-width: 2px;
    border-style: solid;
    width: 100%;
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    line-height: 18px;
    background-color: #ffffff;

    .icon {
      vertical-align: -7px;
      margin-right: 6px;
      pointer-events: none;
    }
  }

  &.primary {
    background-color: var(--primary-color);
    padding: 8px 14px 9px;
    color: #ffffff;
    -webkit-box-shadow: inset 0px -2px 0px 0px rgba(0, 0, 0, 0.25);
    -moz-box-shadow: inset 0px -2px 0px 0px rgba(0, 0, 0, 0.25);
    box-shadow: inset 0px -2px 0px 0px rgba(0, 0, 0, 0.25);

    &:not(:disabled):hover {
      background-color: var(--primary-hover-color);
    }
  }

  &.primary.is-disabled,
  &.primary.is-disabled:hover,
  &.primary:disabled,
  &.primary[disabled],
  &.primary:disabled:hover {
    cursor: not-allowed;
    border-color: var(--primary-disabled-color);
    color: #ffffff;
    background-color: var(--primary-disabled-color);
  }

  &.primary.red {
    background-color: var(--error-color);
    border-width: 1px;
    border-style: solid;
    border-color: transparent;
    color: #ffffff;
    -webkit-box-shadow: inset 0px -2px 0px 0px rgba(0, 0, 0, 0.25);
    -moz-box-shadow: inset 0px -2px 0px 0px rgba(0, 0, 0, 0.25);
    box-shadow: inset 0px -2px 0px 0px rgba(0, 0, 0, 0.25);

    &:not(:disabled):hover {
      background: var(--error-color-light);
    }
  }

  &.primary.red.is-disabled,
  &.primary.red.is-disabled:hover,
  &.primary.red:disabled,
  &.primary.red[disabled] {
    cursor: not-allowed;
    border-color: var(--error-color-light);
    color: #ffffff;
    background-color: var(--error-color-light);
  }

  &.secondary {
    background-color: #ffffff;
    border-width: 1px;
    border-style: solid;
    border-color: variables.$secondary-color;
    color: variables.$secondary-color;
    box-shadow: none;
    padding: 8px 12px 7px;

    &:not(:disabled):hover {
      border-color: color.adjust(variables.$secondary-color, $lightness: -8%);
      color: color.adjust(variables.$secondary-color, $lightness: -8%);
    }
  }

  &.secondary.red {
    background-color: #ffffff;
    border: 1px solid var(--error-color);
    box-shadow: none;
    color: var(--error-color);

    &:not(:disabled):hover {
      border-color: var(--error-color-light);
      color: var(--error-color-light);
    }
  }

  &.secondary.blue {
    background-color: #ffffff;
    border-width: 1px;
    border-style: solid;
    border-color: var(--primary-color);
    color: var(--primary-color);
    box-shadow: none;

    &:not(:disabled):hover {
      background-color: var(--secondary-hover-color);
      border-color: var(--primary-color);
      color: var(--primary-color);
    }
  }

  &.secondary.smallPadding {
    padding: 3px 12px 3px;
  }

  &.secondary.is-disabled,
  &.secondary.is-disabled:hover,
  &.secondary:disabled,
  &.secondary[disabled] {
    cursor: not-allowed;
    color: var(--secondary-light-color);
    border-color: var(--secondary-light-color);
  }

  &.github {
    border-color: #24292e;
    color: #24292e;

    &:not(:disabled):hover {
      background-color: #f4f4f4;
    }
  }

  &.gitlab {
    border-color: #e24329;
    color: #e24329;

    &:not(:disabled):hover {
      background-color: #fdf5f4;
    }
  }

  &.bitbucket {
    border-color: #2684ff;
    color: #2684ff;

    &:not(:disabled):hover {
      background-color: #f5faff;
    }
  }

  &.traditional {
    border-color: #326de6;
    color: #326de6;

    &:not(:disabled):hover {
      background-color: variables.$primary-light-color;
    }
  }
}
